﻿@namespace BlazorComponent
@inherits BDomComponentBase

<button @ref="Ref"
        @onclick="HandleClickAsync"
        @onclick:preventDefault
        @onmousedown="() => HasMouseDown = true"
        @onmouseup="() => HasMouseDown = false"
        Class="@CssProvider.GetClass()"
        Style="@CssProvider.GetStyle()"
        @attributes="@Attributes">

    @ChildContent?.Invoke(IsActive)

    @if (!HideActions)
    {
        <FadeTransition>
            <ShowTransitionElement Tag="div" Value="!IsDisabled" Class="@CssProvider.GetClass("headerIcon")">
                @if (ActionsContent != null)
                {
                    @ActionsContent
                }
                else
                {
                    <BIcon @attributes="GetAttributes(typeof(BIcon))">
                        @ExpandIcon
                    </BIcon>
                }
            </ShowTransitionElement>
        </FadeTransition>
    }
</button>